package com.hhd.pdf.components;

import com.hhd.pdf.context.GeneratorContext;
import com.hhd.pdf.variable.VariableContext;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Element;
import com.hhd.pdf.CommonUtils;
import org.dom4j.tree.DefaultElement;

import java.io.IOException;
import java.util.Collection;
import java.util.List;

public interface InLineBlockComponent extends PdfComponent, InLineComponent {

    List<Element> createElements(org.dom4j.Element element, GeneratorContext context, VariableContext rootVariableContext) throws DocumentException, IOException;

    @Override
    default String getFormula(DefaultElement defaultElement) {
        return defaultElement.asXML();
    }

    @Override
    default Collection<? extends com.itextpdf.text.Element> createPdfElement(DefaultElement defaultElement, GeneratorContext context, String parsedFormula) throws DocumentException, IOException {
        return CommonUtils.newList();
    }
}
